import router from '@/router'

router.beforeEach((to, from, next) => {
    let token = sessionStorage.getItem('token')

    if (to.path === '/login') next()


    // 判断有没有token，没有拦截到登录页，否则放行
    if (!token) {
        next('/login')
    } else {
        next()
    }
})
